package com.ziyun.erp.modules.message.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.ziyun.erp.common.e.message.LaunchShapeEnum;
import com.ziyun.erp.common.e.message.MessageTypeEnum;
import com.ziyun.erp.common.utils.EnumUtil;

import java.io.Serializable;
import java.util.Date;

/**
 * erp提示消息
 * 
 * @author zh
 * @email 296588519@qq.com
 * @date 2018-08-13 14:22:52
 */
@TableName("erp_message")
public class MessageEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 消息ID
	 */
	@TableId
	private Integer id;
	/**
	 * 标题
	 */
	private String title;
	/**
	 * 内容
	 */
	private String content;
	/**
	 * type(xitong:系统消息, jiangfa:奖罚消息,yingxiao营销消息)
	 */
	private String messageType;
	/**
	 * type(zhannei:站内消息, tanchuang:弹窗消息)
	 */
	private String launchShape;
	/**
	 * 投放渠道
	 */
	private String launchChannel;
	/**
	 * 是否删除(1删除,0不删除)
	 */
	private Boolean delFlag;

	/**
	 * 是否已读1已读,0未读)
	 */
	@TableField(exist = false)
	private Integer readFlag;

	/**
	 * 显示时间
	 */
	private Date displayDate;
	/**
	 * 创建时间
	 */
	private Date createDate;
	/**
	 * 创建人员
	 */
	private String createUser;

	/**
	 * 设置：消息ID
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	/**
	 * 获取：消息ID
	 */
	public Integer getId() {
		return id;
	}
	/**
	 * 设置：标题
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	/**
	 * 获取：标题
	 */
	public String getTitle() {
		return title;
	}
	/**
	 * 设置：内容
	 */
	public void setContent(String content) {
		this.content = content;
	}
	/**
	 * 获取：内容
	 */
	public String getContent() {
		return content;
	}
	/**
	 * 设置：type(xitong:系统消息, jiangfa:奖罚消息,yingxiao营销消息)
	 */
	public void setMessageType(String messageType) {
		this.messageType = messageType;
	}
	/**
	 * 获取：type(xitong:系统消息, jiangfa:奖罚消息,yingxiao营销消息)
	 */
	public String getMessageType() {
		return messageType;
	}

	public String getMessageTypeTxt() {
		return EnumUtil.getEnumByCode(MessageTypeEnum.class, messageType).toDescribe();
	}
	/**
	 * 设置：type(zhannei:站内消息, tanchuang:弹窗消息)
	 */
	public void setLaunchShape(String launchShape) {
		this.launchShape = launchShape;
	}
	/**
	 * 获取：type(zhannei:站内消息, tanchuang:弹窗消息)
	 */
	public String getLaunchShape() {
		return launchShape;
	}

	public String getLaunchShapeTxt() {
		return EnumUtil.getEnumByCode(LaunchShapeEnum.class, launchShape).toDescribe();
	}
	/**
	 * 设置：投放渠道
	 */
	public void setLaunchChannel(String launchChannel) {
		this.launchChannel = launchChannel;
	}
	/**
	 * 获取：投放渠道
	 */
	public String getLaunchChannel() {
		return launchChannel;
	}
	/**
	 * 设置：是否删除(1删除,0不删除)
	 */
	public void setDelFlag(Boolean delFlag) {
		this.delFlag = delFlag;
	}
	/**
	 * 获取：是否删除(1删除,0不删除)
	 */
	public Boolean getDelFlag() {
		return delFlag;
	}
	/**
	 * 设置：显示时间
	 */
	public void setDisplayDate(Date displayDate) {
		this.displayDate = displayDate;
	}
	/**
	 * 获取：显示时间
	 */
	public Date getDisplayDate() {
		return displayDate;
	}
	/**
	 * 设置：创建时间
	 */
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	/**
	 * 获取：创建时间
	 */
	public Date getCreateDate() {
		return createDate;
	}
	/**
	 * 设置：创建人员
	 */
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	/**
	 * 获取：创建人员
	 */
	public String getCreateUser() {
		return createUser;
	}

	public String getReadFlag() {
		String readFlagTxt = "未读";
		if (readFlag!=null && readFlag == 1){
			readFlagTxt = "已读";
		}
		return readFlagTxt;
	}

}
